import Vue from "vue";
import VueRouter from "vue-router";
import login from "../components/login.vue";
import order from "../views/order.vue"
import cargo from "../views/cargo.vue"
import stock from "../views/stock.vue"
import purchase from "../views/purchase.vue"
import using from "../views/using.vue"
import salesOrder from "../views/salesOrder.vue"
import gys from '../views/gys.vue';
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "login",
    component: login,
    meta: {
      title: "汽车管理系统",
      keepAlive: false,
    },
  },
  {
    path: "/index",
    name: "index",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/index.vue"),
      children: [
        {
          path: "/order",
          component: order,
          name: "order",
          meta: {
            title: "汽车管理",
            keepAlive: false,
          },
        },
        {
          path: "/cargo",
          component: cargo,
          name: "cargo",
          meta: {
            title: "库存管理",
            keepAlive: false,
          },
        },
        {
          path: "/stock",
          component: stock,
          name: "stock",
          meta: {
            title: "仓库管理",
            keepAlive: false,
          },
        },
        {
          path: "/purchase",
          component: purchase,
          name: "purchase",
          meta: {
            title: "采购订单",
            keepAlive: false,
          },
        },
        {
          path: "/gys",
          component: gys,
          name: "gys",
          meta: {
            title: "供应商管理",
            keepAlive: false,
          },
        },
        {
          path: "/using",
          component: using,
          name: "using",
          meta: {
            title: "零件表",
            keepAlive: false,
          },
        },
        {
          path: "/using",
          component: using,
          name: "using",
          meta: {
            title: "零件表",
            keepAlive: false,
          },
        },
        {
          path: "/salesOrder",
          component: salesOrder,
          name: "salesOrder",
          meta: {
            title: "销售订单管理",
            keepAlive: false,
          },
        },
      ]
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});


export default router;
